home *** CD-ROM | disk | FTP | other *** search
/ Top 200 Programs / Top 200 Programs.iso / Bob8 / THOMPSON / LIBERTY / PRODUCT / LB14W.EXE / FONTBUG.BAS < prev    next >
BASIC Source File  |  1997-03-25  |  3KB  |  96 lines

  1.  
  2.     'this program was built to test for a certain bug but it also
  3.     'makes a good example of the new font capabilites of
  4.     'Liberty BASIC v1.4
  5.  
  6. '** This program was enhanced with "Enhancer Pro"
  7.  
  8. [main.Begin] 'Design the window
  9.     '** Set Window Attributes
  10.     NOMAINWIN 'Turn main window off
  11.     UpperLeftX = int((DisplayWidth- 404)/2) 'Center window horizontally on screen
  12.     UpperLeftY = int((DisplayHeight- 265)/2) 'Center window vertically on screen
  13.     WindowWidth = 410
  14.     WindowHeight = 340
  15.  
  16.     '** Add Window Controls
  17.     texteditor #main.te2,  208,  8,  184,  152
  18.     texteditor #main.te1,  8,  8,  192,  152
  19.     textbox #main.tb1,  16,  192,  112,  24
  20.     statictext #main.Statictext4, "Font_Name w h",  8,  168,  100,  18
  21.     statictext #main.Statictext7, "Font_Name w h",  208,  168,  100,  18
  22.     button #main.apply1, "Apply", [applyFont1], UL,  136,  192,  67,  24
  23.     textbox #main.tb2,  216,  192,  112,  24
  24.     button #main.apply2, "Apply", [applyFont2], UL,  336,  192,  56,  24
  25.  
  26.     radiobutton #main.rb1, "Radiobutton 1", [set], [clear], 16, 226, 190, 20
  27.     radiobutton #main.rb2, "Radiobutton 2", [set], [clear], 216, 226, 190, 20
  28.  
  29.     checkbox #main.cb1, "Checkbox 1", [set], [clear], 16, 256, 190, 20
  30.     checkbox #main.cb2, "Checkbox 2", [set], [clear], 216, 256, 190, 20
  31.  
  32.     Menu #main, "&Edit"    '** Display window
  33.     open "Untitled" for window as #main
  34.     print #main, "TRAPCLOSE [main.END]"
  35.  
  36.     print #main.te1, "Enter a font name"
  37.     print #main.te1, "and width and height"
  38.     print #main.te1, "in the field below"
  39.     print #main.te1, "and click the button."
  40.     print #main.te1, "Example:"
  41.     print #main.te1, "courier_new 8 15"
  42.  
  43.     print #main.te2, "Enter a font name"
  44.     print #main.te2, "and width and height"
  45.     print #main.te2, "in the field below"
  46.     print #main.te2, "and click the button."
  47.     print #main.te2, "Example:"
  48.     print #main.te2, "roman 8 15"
  49.  
  50. [main.inputLoop] 'Scan for user events
  51.     '** Additional code can go here for background processing
  52.     Scan
  53.     Goto [main.inputLoop]
  54.  
  55. [main.END] 'Exit the program
  56.     '** Confirm on exit routine
  57.     confirm " Do you want to exit? "; ANSWER$
  58.     if ANSWER$="no" then Goto [main.inputLoop]
  59.     close #main
  60.     END
  61.  
  62.  
  63. [set]  'do nothing
  64.     goto [main.inputLoop]
  65.  
  66.  
  67. [clear]  'do nothing
  68.     goto [main.inputLoop]
  69.  
  70.  
  71. [applyFont1]  'Insert code for the Button called apply1
  72.     '**Insert your code here
  73.     print #main.tb1, "!contents?";
  74.     input #main.tb1, fontName$
  75.     print #main.te1, "!font "; fontName$;
  76.     print #main.apply1, "!font "; fontName$;
  77.     print #main.Statictext4, "!font "; fontName$;
  78.     print #main.tb1, "!font "; fontName$;
  79.     print #main.rb1, "font "; fontName$;
  80.     print #main.cb1, "font "; fontName$;
  81.     Goto [main.inputLoop] 'Check for more user events
  82.  
  83. [applyFont2]  'Insert code for the Button called apply2
  84.     '**Insert your code here
  85.     print #main.tb2, "!contents?";
  86.     input #main.tb2, fontName$
  87.     print #main.te2, "!font "; fontName$;
  88.     print #main.apply2, "!font "; fontName$;
  89.     print #main.Statictext7, "!font "; fontName$;
  90.     print #main.tb2, "!font "; fontName$;
  91.     print #main.rb2, "font "; fontName$;
  92.     print #main.cb2, "font "; fontName$;
  93.     Goto [main.inputLoop] 'Check for more user events
  94.  
  95.  
  96.